/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    usart.h
  * @brief   This file contains all the function prototypes for
  *          the usart.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__
#define __USART_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern UART_HandleTypeDef huart1;

extern UART_HandleTypeDef huart2;

/* USER CODE BEGIN Private defines */

#define RX_MAXLEN 100

/* USER CODE END Private defines */

void MX_USART1_UART_Init(void);
void MX_USART2_UART_Init(void);

/* USER CODE BEGIN Prototypes */
//typedef struct _Transmit_Buf_Struct_ // ������¼���͵�����
//{
//	char para_id_name[5];
//	char para_string[7];
//}Transmit_Buf_Struct;
	

typedef struct _Transmit_Buf_Struct_ // ������¼���͵�����
{
	char para_id_name[5];
	float para_string;
}Transmit_Buf_Struct;

typedef struct _Receive_Buf_Struct_ // ������¼��������
{
	uint8_t Receive_Cmd; // ������ݵ�����?0x00��6��PID������0x01-0x10��Ӧ��ͬ����������
	float Receive_Para[10]; // �ٶȻ���λ�û���6��PID��������
}Receive_Buf_Struct;

HAL_StatusTypeDef Uart_Transmit(UART_HandleTypeDef *huart, const uint8_t *pData, uint16_t Size, uint32_t Timeout);
void Transmit_Buf_Struct_Get(Transmit_Buf_Struct* Transmit_Buffer);

extern Transmit_Buf_Struct Transmit_Buf[12];
extern Receive_Buf_Struct Receive_Buf; // ��RxBuffer��ȡ������ָ��Ͳ���?
extern uint8_t RxBuffer; // ���յ�����
extern uint8_t RxBuffer_List[RX_MAXLEN]; // �������uart���ڵ�����

/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */

